int loop(int x,int n){
	int result=1431655765;
	int mask;
	for(mask=-2147483648;mask!=0;mask=mask<0?-mask>>n:mask>>n){
		result^=(mask&x);
		}
	return result;
	}
	switch(action){
case MODE_A:  result=*p1;
              *p1=*p2;
              break;
case MODE_B:  result=*p1+*p2;
              *p2=result;
              break;
case MODE_C:  *p2=15;
              result=*p1;
               break;
case MODE_D:  *p2=*p1;
               result=17;
               break;
case MODE_E:  result=17;
              break;
default:        result=-1;
              break;
}